package spt.jukg.singleton.start;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.core.annotation.Order;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

import spt.jukg.singleton.service.MainService;
import spt.jukg.singleton.util.RedisUtil;
@Component
@Order(1)
public class Start1 implements CommandLineRunner{

	@Autowired
	private RedisTemplate redisTemplate;
	@Autowired
	private MainService mainService;
	@Override
	@Async
	public void run(String... args) throws Exception {
		// TODO Auto-generated method stub
		System.out.println("start1....启动了");
		//参数装入redis
		RedisUtil.set("first", "bbbb");
		List list=mainService.getInfo("1");
		RedisUtil.setList("info",list);
	}

}
